// 自定义下拉
$f-custom-select-focus-border-color: $f-input-focus-border-color;
$f-custom-select-box-shadow: $f-input-box-shadow;
$f-custom-select-focus-box-shadow: $f-input-focus-box-shadow;

// 复写按钮样式
@mixin f-button-setting($f-background,
    $f-border,
    $f-hover-background,
    $f-hover-border,
    $f-active-background,
    $f-active-border,
    $f-color,
    $f-hover-color,
    $f-active-color,
    $f-disabled-background: $farris-btn-disabled-bg,
    $f-disabled-border: $farris-btn-disabled-border-color,
    $f-disabled-color: $farris-btn-disabled-color,
    $f-has-box-shadow: $f-btn-box-shadow,
    $f-focus-box-shadow: $f-btn-focus-box-shadow,
    $f-active-box-shadow: $f-btn-active-box-shadow) {
    color: $f-color;
    background: $f-background;
    border-color: $f-border;
    box-shadow: $f-has-box-shadow;

    &:hover {
        color: $f-hover-color;
        background: $f-hover-background;
        border-color: $f-hover-border;
        box-shadow: $f-focus-box-shadow;
    }

    &:not(:disabled):not(.disabled):focus,
    &:not(:disabled):not(.disabled).focus {
        box-shadow: $f-focus-box-shadow;
    }

    &.disabled,
    &:disabled {
        color: $f-disabled-color;
        background: $f-disabled-background;
        border-color: $f-disabled-border;
        box-shadow: none;
    }

    &:not(:disabled):not(.disabled):active,
    &:not(:disabled):not(.disabled).active,
    .show>&.dropdown-toggle {
        color: $f-active-color;
        background: $f-active-background;
        border-color: $f-active-border;
        @include f-has-box-shadow($f-active-box-shadow);

        &:focus {
            box-shadow: $f-focus-box-shadow;
        }
    }
}

// 复写带边框按钮样式
@mixin f-button-outline-setting($f-color,
    $f-color-hover: f-color-rgb-result($f-color),
    $f-active-background: $f-color,
    $f-active-border: $f-color,
    $f-has-box-shadow: $farris-btn-box-shadow-outline,
    $f-focus-box-shadow: $farris-btn-focus-box-shadow-outline,
    $f-active-box-shadow: $farris-btn-active-box-shadow-outline) {
    color: $f-color;
    background-color: transparent;
    background-image: none;
    border-color: $f-color;
    @include f-has-box-shadow($f-has-box-shadow);

    &:hover {
        color: $f-color-hover;
        background-color: $f-active-background;
        border-color: $f-active-border;
    }

    &:focus,
    &.focus {
        @if $f-has-shadows {
            box-shadow: $f-focus-box-shadow;
        }

        @else {
            box-shadow: none;
        }
    }

    &:active,
    &.active {
        @if $f-has-shadows {
            box-shadow: $f-active-box-shadow;
        }

        @else {
            box-shadow: none;
        }
    }

    &.disabled,
    &:disabled {
        color: $f-color;
        background-color: transparent;
    }

    &:not(:disabled):not(.disabled):active,
    &:not(:disabled):not(.disabled).active,
    .show>&.dropdown-toggle {
        color: f-color-rgb-result($f-active-background);
        background-color: $f-active-background;
        border-color: $f-active-border;

        &:focus {
            box-shadow: $farris-btn-focus-box-shadow-outline;
        }
    }
}

@mixin f-cursor-line-down {
    border-top: $f-cursor-line-width solid;
    border-right: $f-cursor-line-width solid transparent;
    border-bottom: 0;
    border-left: $f-cursor-line-width solid transparent;
}

@mixin f-cursor-line-up {
    border-top: 0;
    border-right: $f-cursor-line-width solid transparent;
    border-bottom: $f-cursor-line-width solid;
    border-left: $f-cursor-line-width solid transparent;
}

@mixin f-cursor-line-right {
    border-top: $f-cursor-line-width solid transparent;
    border-right: 0;
    border-bottom: $f-cursor-line-width solid transparent;
    border-left: $f-cursor-line-width solid;
}

@mixin f-cursor-line-left {
    border-top: $f-cursor-line-width solid transparent;
    border-right: $f-cursor-line-width solid;
    border-bottom: $f-cursor-line-width solid transparent;
}


// 复写下拉菜单
@mixin cursor-line($f-direction: down) {
    @if $f-has-cursor-line {
        &::after {
            display: inline-block;
            width: 0;
            height: 0;
            margin-left: $farris-dropdown-toggle-margin-left;
            vertical-align: $farris-dropdown-toggle-vertical-align;
            content: "";

            @if $f-direction==down {
                @include f-cursor-line-down;
            }

            @else if $f-direction==right {
                @include f-cursor-line-right;
            }

            @else if $f-direction==up {
                @include f-cursor-line-up;
            }


        }

        @if $f-direction==left {
            &::after {
                display: none;
            }

            &::before {
                display: inline-block;
                width: 0;
                height: 0;
                margin-right: $farris-dropdown-toggle-margin-right;
                vertical-align: $farris-dropdown-toggle-vertical-align;
                content: "";
                @include f-cursor-line-left;
            }
        }

        &:empty::after {
            margin-left: 0;
        }
    }
}